// pages/index2/index2.js
Page({
    /**
     * 组件的属性列表
     */
    properties: {},
    /**
     * 组件的初始数据
     */
    data: {
        termid:"",
        list: null,
        header: null,
        terms: [{
            name: "2022-2023 第一学期",
            id: 2
        },
        {
            name: "2022-2023 第二学期",
            id: 2
        },
        {
            name: "2023-2024 第一学期",
            id: 3
        },
    ],
    },
    changes(e) {
        this.setData({
            termid:e.detail.selectId
        })        
        console.log(e.detail.selectId);
        console.log(e.detail.select);
        var that = this;
        wx.request({
            url: 'http://vz3q9q.natappfree.cc/getAllScore?classno=1&term='+this.data.termid,
            method: 'POST',
            data: {
                rnum: 2,
                username: 'test1'
            },
            header: {
                'content-type': 'application/x-www-form-urlencoded'
            },
            dataType: 'json',
            success(res) {
                console.log(res.data);
                that.setData({
                    list: res.data.data,
                    header: res.data.headers
                });
            }
        });
      //   process();
    },
    onShow: function (e) {
      
    }
})